# This code is part of the MWP System
# Copyright (c) 2012 Benjamin Lubin (blubin@bu.com) 
# Published under and subject to the GPLv2 license available at http://www.gnu.org/licenses/gpl-2.0.html

'''
Created on Dec 18, 2012
@author: blubin
'''

from frontend.roleApplication import RoleApplication;
from frontend.form import Type;

class ShippingApplication(RoleApplication):
    """ The Physician User Interface """

    def __init__(self):
        super(ShippingApplication, self).__init__("DentalOrder", "Shipping")
        self.register_transition_step("OrderReceived", self.order_received_form_creator, name_fields=["customername", "customernumber", "deliverydate"])
        self.register_transition_step("HoldOrder", self.hold_order_form_creator, name_fields=["customername", "customernumber", "deliverydate"])
        self.register_transition_step("ShipOrder", self.ship_order_form_creator, name_fields=["customername", "customernumber", "deliverydate"])

    def order_received_form_creator(self, stepname, form):
        form.add_static_Label('Please indicate which items and how many are missing from the order. If order is complete, please check Inventory in Stock.')
        form.add_static_Label("Anesthetic: ", "QuantityAnesthetic")
        form.add_static_Label("Latex: ", "QuantityLatex")
        form.add_static_Label("Flouride: ", "QuantityFluoride")
        form.add_static_Label("Cleaning Instrument: ", "QuantityCleaning")
        form.add_static_Label("Floss: ", "QuantityFloss")
        form.add_field(Type.INTEGER, "MissingAnesthetic", labeltext="Anesthetic", initial=0)
        form.add_field(Type.INTEGER, "MissingLatex", labeltext="Latex Gloves", initial=0)
        form.add_field(Type.INTEGER, "MissingFluoride", labeltext="Fluoride Paste", initial=0)
        form.add_field(Type.INTEGER, "MissingCleaning", labeltext="Cleaning Instrument", initial=0)
        form.add_field(Type.INTEGER, "MissingFloss", labeltext="Floss", initial=0)
        form.add_field(Type.BOOLEAN, "inventoryinstock");
        
    def hold_order_form_creator(self, stepname, form):
        pass
        
    def ship_order_form_creator(self, stepname, form):             
        pass
        

if __name__ == '__main__':
    app = ShippingApplication();
    app.MainLoop();